\chapter{Functions of \projname}
\section{Change Settings} \label{settings}
First of all you can fit \projname to your personal pleasure with editing the
settings. To do this click in the menu bar on \textit{File} in the menu bar and
then on \textit{Change Settings}.
\begin{figure}[htb]
\begin{center}
\includegraphics[keepaspectratio, width=0.6\textwidth]{pics/12settings}
\end{center}
\caption{settings dialog}
\label{pic12}
\end{figure}
Here you can change the paths to Osmosis, JOSM and your default working
directory. 
\begin{itemize} 
   \item Osmosis you have to link to the \textit{osmosis.sh} or
   \textit{osmosis.bat} in the bin folder of the installation folder of Osmosis
   \item JOSM you have to link to the \textit{josm-tested.jar}
\end{itemize}
Then you can change the language for OSMembrane. You can also
define if you want to support short task names and export default values of parameters.
The maximum undo depth determines how many actions you can undo and of course
redo. Changes which date back farther than this amount are deleted.
The default zoom level determines the size of the symbols in the pipeline
view. The greater the number the bigger the symbols.
If you activate the option \textit{Pipeline raster size} then the functions in
the pipeline view will be arranged on a raster with the cell size you specify.

\section{Load \& Save} \label{loadsave}
To load or save a pipeline you can either click on the buttons in the toolbar or
click in the menu bar firstly on \textit{file} and then on the entry you need.
If there is an unsaved pipeline the program asks you if you want to save before
loading or discard the changes. Then a dialog asks you where the location is and
how the name of the file is. 
\newline The suffix of a file containing a saved pipeline is \textit{.osmembrane}.

\section{Import \& Export} \label{importexport}
Importing and exporting pipelines is very similar to loading and saving. The
only difference is the amount of supported types of the file and due to this the
suffix: \textit{.osmembrane} as usual, \textit{.bat} and \textit{.cmd} for
bash and \textit{.sh} for shell.
\newline The bash and shell files can be executed.

\section{Editing the Pipeline}
\subsection{Using the tools}
As described in \ref{toolbar} \nameref{toolbar} you can use the magic tool for
everything. If you want to do only one special action you can use those tools:
\begin{itemize}
  \item the magic tool - on functions and connections like 
  the selection tool, on empty space like the view tool and on connectors like 
  the connection tool
  \item the selection tool - lets you select functions and connections between
  functions
  \item the view tool - lets you move the view by clicking and dragging as well
  as zooming by dragging while the Control key is pressed
  \item the connection tool - lets you add connections by clicking on a source
  function and then on a target function
\end{itemize}
\subsection{Dealing with Functions}
To place a function in the pipeline view you can drag and drop it into the
pipeline view. You have to be careful to put it not into another view because
this results in a warning.\newline
If you select a function you can edit the parameters in the function inspector.
\subsection{Connecting Functions}
You can connect functions by clicking onto the semi circles of a function and
then draw an arrow to the one you want to connect to. For more details read
\ref{pipes} \nameref{pipes}. If you want to connect to a connector with more
than one type of connectors \projname chooses the right one.
\subsection{Selecting areas} \label{special}
There is a feature for the bounding boxes to select a specific area. If you
click on \textit{Entity Bounding Box} for example you can choose the area by drawing a
bounding box on the map (see picture \ref{pic13}).
\begin{figure}[htb]
\begin{center}
\includegraphics[keepaspectratio, width=0.4\textwidth]{pics/13bounding}
\end{center}
\caption{Selecting the area of the computer science building of the University
of Stuttgart by bounding box}
\label{pic13}
\end{figure}
To select an area by polygons you can choose the \textit{Entity Bounding
Polygon} and select a text file containing the polygon (see picture
\ref{pic14}). 
\begin{figure}[htb]
\begin{center}
\includegraphics[keepaspectratio, width=0.3\textwidth]{pics/14polygon}
\end{center}
\caption{Parameter for a file with polygon coordinates}
\label{pic14}
\end{figure}
\subsection{List of Keys}
Some tasks can accept certain lists of keys to define a special behavior. One of
these tasks is \textit{Node Filters}. As you can see in picture \ref{pic15} you
can click on the button to the right of the text \textit{keyList} to call a
assistent for the entries in the list of this specific function. 
\begin{figure}[htb]
\begin{center}
\includegraphics[keepaspectratio, width=0.35\textwidth]{pics/15nodefilter}
\end{center}
\caption{Function Node Filtesr}
\label{pic15}
\end{figure}
To add a certain key to the list you can type the name of the key into the text
field. If the name is known there is an auto complete to help you. You can also
add unknown keys or simply select by dropping down the box and click on one. To
add a key you have to click on the \textit{add} button.\newline
If you have created a extensive list you can save it for the future aswell.
\begin{figure}[htb]
\begin{center}
\includegraphics[keepaspectratio, width=0.5\textwidth]{pics/16keylist}
\end{center}
\caption{Assisstent to edit a list of keys} 
\label{pic16}
\end{figure}
\subsection{Undo \& Redo} \label{undo}
If you edit a pipeline and you want to return to a state some time before you
can undo the state some time before by clicking in the menu bar on
\textit{Edit} and then on \textit{Undo} or by clicking on the yellow arrow in 
the toolbar. If you undid something and did not change the pipeline since then 
you can redo it by clicking on \textit{Edit} in the menubar and then on 
\textit{Redo} or on the green arrow in the toolbar.
\newline How many undo and steps are possible can be set in the settings (see
\ref{settings} \nameref{settings}).
\subsection{Duplicate Function} \label{duplicate}
To duplicate a selected function you can click on \textit{Edit} and
\textit{Duplicate a Function} in the menu bar.
\newline By duplicating a function you duplicate all changed parameters done for the
function as well.

\section{Using the created pipeline}
\subsection{Access a preview}
If you want to see what the created pipeline looks like you can use the preview.
It executes the pipeline with Osmosis and calls JOSM with the created
\textit{.osm file}. JOSM will show you what you just created (like in picture
\ref{pic19}. 
\begin{figure}[htb]
\begin{center}
\includegraphics[keepaspectratio, width=0.5\textwidth]{pics/19josm}
\end{center}
\caption{JOSM shows the computer science building of the University of Stuttgart}
\label{pic19}
\end{figure}
\newpage
\subsection{Generate a command line}
If you want to see the command line for your pipeline, you can let \projname
do it. The file JOSM shows in the picture \ref{pic19} is the output of the
commandline in picture \ref{pic18}.
\begin{figure}[htb]
\begin{center}
\includegraphics[keepaspectratio, width=0.5\textwidth]{pics/18exportcmd}
\end{center}
\caption{Simple Pipeline as a command line}
\label{pic18}
\end{figure}
\newpage
\subsection{Run Osmosis with the generated command line}
You can let Osmosis execute your pipeline without showing you the commandline
and any preview. Then you get the ouput of Osmosis to the command line directly
in \projname. In picture \ref{pic20} you see the output of Osmosis for the same
example like in the two pictures before. 
\begin{figure}[htb]
\begin{center}
\includegraphics[keepaspectratio, width=0.5\textwidth]{pics/20osmosis}
\end{center}
\caption{Output of Osmosis for the computer science building}
\label{pic20}
\end{figure}
